package com.neteast.bustruck.http

open class BaseRespon<T> {

    var code: Int = 0
    var data: T?=null
    var msg: String =""
    var success: Boolean =true




    inline fun onSuccess(block: (T) -> Unit) {
        if (success) {
            block(data!!)
        }
    }

    inline fun onError(block: (String) -> Unit) {
        if (!success) {
            block(msg)
        }
    }


}



